﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SmAp.Operator.Interface;
using SmApiLibrary.libs;

namespace SmAp.Operator.OP.Sina
{
    public class Timeline : ITimeline
    {
        const string BASE_URL = "http://api.t.sina.com.cn/statuses";

        #region ITimeline 成员

        public WeiBoType weiboType
        {
            get { throw new NotImplementedException(); }
        }

        public string GetPublicTimeLine(string source, int count, int base_app, OAuthBase oaubase)
        {
            throw new NotImplementedException();
        }

        public string GetPublicTimeLine(int count, int base_app, OAuthBase oaubase)
        {
            throw new NotImplementedException();
        }

        /// <summary>
        /// 获取用户的微博
        /// </summary>
        /// <param name="user_id">用户ID</param>
        /// <returns></returns>
        public string GetUserTimeline(string user_id, OAuthBase oaubase)
        {
            return this.GetUserTimeline(user_id, null, oaubase);
        }

        /// <summary>
        /// 获取用户的微博
        /// </summary>
        /// <param name="user_id">用户ID</param>
        /// <param name="since_id">从那条微博以后开始获取微博</param>
        /// <returns></returns>
        public string GetUserTimeline(string user_id, string since_id, OAuthBase oaubase)
        {
            return this.GetUserTimeline(user_id, since_id, null, 20, oaubase);
        }

        /// <summary>
        /// 获取用户的微博
        /// </summary>
        /// <param name="user_id">用户ID</param>
        /// <param name="max_id">返回ID小于或等于max_id（即比max_id发表时间早的）的微博消息</param>
        /// <param name="count">每页的大小</param>
        /// <returns></returns>
        public string GetUserTimeline(string user_id, string max_id, int count, OAuthBase oaubase)
        {
            return this.GetUserTimeline(user_id, null, max_id, count, oaubase);
        }

        public string GetUserTimeline(string user_id, int count, int page, OAuthBase oaubase)
        {
            string url = string.Format("http://api.t.sina.com.cn/statuses/user_timeline.json?user_id={0}&count={1}&page={2}", user_id, count, page);
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        /// <summary>
        /// 获取用户的微博
        /// </summary>
        /// <param name="user_id">用户ID</param>
        /// <param name="since_id">从那条微博以后开始获取微博</param>
        /// <param name="max_id">返回ID小于或等于max_id（即比max_id发表时间早的）的微博消息</param>
        /// <param name="count">每页的大小</param>
        /// <returns></returns>
        public string GetUserTimeline(string user_id, string since_id, string max_id, int count, OAuthBase oaubase)
        {
            count = Math.Max(count, 5);
            count = Math.Min(count, 200);
            string url = string.Format("http://api.t.sina.com.cn/statuses/user_timeline.json?user_id={0}&count={1}", user_id, count);
            if (!string.IsNullOrEmpty(since_id))
            {
                url += string.Format("&since_id={0}", since_id);
            }
            if (!string.IsNullOrEmpty(max_id))
            {
                url += string.Format("&max_id={0}", max_id);
            }
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        public string GetMentions(OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}?count={2}", BASE_URL, "mentions.json", 200);
            string result = oaubase.OAuthWebRequest(Method.GET, url, null, null);
            return result;
        }

        public string GetMentions(string since_id, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}?since_id={2}", BASE_URL, "mentions.json", since_id);
            string result = oaubase.OAuthWebRequest(Method.GET, url, null, null);
            return result;
        }

        public string GetMentions(string max_id, int count, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}?max_id={2}&count={3}", BASE_URL, "mentions.json", max_id, count);
            string result = oaubase.OAuthWebRequest(Method.GET, url, null, null);
            return result;
        }


        public string GetMentions(int count, int page, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}?count={2}&page={3}", BASE_URL, "mentions.json", count, page);
            string result = oaubase.OAuthWebRequest(Method.GET, url, null, null);
            return result;
        }

        public string GetCommentsByMe(OAuthBase oaubase)
        {
            throw new NotImplementedException();
        }

        public string GetCommentsByMe(string since_id, OAuthBase oaubase)
        {
            throw new NotImplementedException();
        }

        public string GetCommentsToMe(OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}", BASE_URL, "comments_to_me.json");
            string result = oaubase.OAuthWebRequest(Method.GET, url, null, null);
            return result;
        }

        public string GetCommentsToMe(OAuthBase oaubase, int count, int page)
        {
            string url = string.Format("{0}/{1}?count={2}&page={3}", BASE_URL, "comments_to_me.json", count, page);
            string result = oaubase.OAuthWebRequest(Method.GET, url, null, null);
            return result;
        }


        public string GetCommentsToMe(string since_id, OAuthBase oaubase)
        {
            throw new NotImplementedException();
        }

        public string GetCommentsToMe(string max_id, int count, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}?max_id={2}&count={3}", BASE_URL, "comments_to_me.json", max_id, count);
            string result = oaubase.OAuthWebRequest(Method.GET, url, null, null);
            return result;
        }

        public string GetComments(string id, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}?id={2}", BASE_URL, "comments.json", id);
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        /// <summary>
        /// 根据微博消息ID返回某条微博消息的评论列表 
        /// </summary>
        /// <param name="id">微博ID</param>
        /// <param name="count">单页返回的记录条数(默认值20，最大值200)</param>
        /// <param name="page">返回结果的页码(默认值1)</param>
        /// <returns></returns>
        public string GetComments(string id, int count, int page, OAuthBase oaubase)
        {
            if (count <= 0)
                count = 20;
            else if (count > 200)
                count = 200;
            if (page <= 0) page = 1;
            string url = @"http://api.t.sina.com.cn/statuses/comments.json?" + string.Format("id={0}&count={1}&page={2}", id, count, page);

            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }

        /// <summary>
        /// 批量获取n条微博消息的评论数和转发数。一次请求最多可以获取20条微博消息的评论数和转发数
        /// </summary>
        /// <param name="ids">ID列表，用逗号隔开</param>
        /// <returns></returns>
        public string GetCounts(string ids, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}?ids={2}", BASE_URL, "counts.json", Utility.UrlEncode(ids));
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        /// <summary>
        /// 将当前登录用户的某种新消息的未读数为0。可以清零的计数类别有：1. 评论数，2. @me数，3. 私信数，4. 关注数
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public string ResetCount(string type, OAuthBase oaubase)
        {
            string url = @"http://api.t.sina.com.cn/statuses/reset_count.json";
            string para = string.Format("type={0}", type);
            return oaubase.OAuthWebRequest(Method.POST, url, para, null);
        }

        /// <summary>
        /// 获取当前用户Web主站未读消息数，包括：是否有新微博消息，最新提到“我”的微博消息数， 新评论数， 新私信数，新粉丝数。
        /// </summary>
        /// <param name="oaubase"></param>
        /// <returns></returns>
        public string GetUnReadCount(OAuthBase oaubase)
        {
            string url = @"http://api.t.sina.com.cn/statuses/unread.json";
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        /// <summary>
        /// 验证当前用户身份是否合法，通行证成功并开通微博，返回 user
        /// </summary>
        /// <returns></returns>
        public string VerifyCredentials(OAuthBase oaubase)
        {
            string url = "http://api.t.sina.com.cn/account/verify_credentials.json";
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        /// <summary>
        /// 按用户ID返回用户资料以及用户的最新发布的一条微博消息。
        /// </summary>
        /// <returns></returns>
        public string GetUserInfo(string user_id, OAuthBase oaubase)
        {
            string url = string.Format("http://api.t.sina.com.cn/users/show.json?user_id={0}", user_id);
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        /// <summary>
        /// 获取系统推荐的用户列表。
        /// </summary>
        /// <param name="type">用户类别</param>
        /// <returns></returns>
        public string GetHotUsers(SinaUserType type, OAuthBase oaubase)
        {
            string category = type.ToString();
            if (category == "def") category = "default";
            string url = string.Format("http://api.t.sina.com.cn/users/hot.json?category={0}", category);
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        /// <summary>
        /// 获取当前用户可能感兴趣的用户
        /// </summary>
        /// <returns></returns>
        public string GetSuggestions(OAuthBase oaubase)
        {
            return GetSuggestions(false, oaubase);
        }

        /// <summary>
        /// 获取当前用户可能感兴趣的用户
        /// </summary>
        /// <param name="with_reason">是否返回推荐原因</param>
        /// <returns></returns>
        public string GetSuggestions(bool with_reason, OAuthBase oaubase)
        {
            int reason_type = with_reason ? 1 : 0;
            string url = string.Format("http://api.t.sina.com.cn/users/suggestions.json?with_reason={0}", reason_type);
            return oaubase.OAuthWebRequest(Method.GET, url, string.Empty);
        }

        /// <summary>
        /// 获取当前登录用户关注列表及每个关注用户的最新一条微博，返回结果(next_cursor字段，表示下一页的cursor)按关注时间倒序排列，最新关注的用户排在最前面。
        /// </summary>
        /// <param name="count">单页返回的记录条数(默认值20，最大值200)</param>
        /// <param name="cursor">分页(-1:返回第一页；0:已经到记录末尾)</param>
        /// <returns></returns>
        public string GetFriends(int count, int cursor, OAuthBase oaubase)
        {
            return GetFriends(null, count, cursor, oaubase);
        }

        /// <summary>
        /// 根据用户Id获取用户关注列表及每个关注用户的最新一条微博，返回结果(next_cursor字段，表示下一页的cursor)按关注时间倒序排列，最新关注的用户排在最前面。
        /// </summary>
        /// <param name="user_id">用户ID</param>
        /// <param name="count">单页返回的记录条数(默认值20，最大值200)</param>
        /// <param name="cursor">分页(-1:返回第一页；0:已经到记录末尾)</param>
        /// <returns></returns>
        public string GetFriends(string user_id, int count, int cursor, OAuthBase oaubase)
        {
            cursor = Math.Max(-1, cursor);
            count = Math.Max(5, count);
            count = Math.Min(200, count);
            string url = string.Format("http://api.t.sina.com.cn/statuses/friends.json?count={0}&cursor={1}", count, cursor);
            //cursor用于分页请求，请求第1页cursor传-1，在返回的结果中会得到next_cursor字段，表示下一页的cursor。next_cursor为0表示已经到记录末尾。
            if (!string.IsNullOrEmpty(user_id))
            {
                url += string.Format("&user_id={0}", user_id);
            }
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        /// <summary>
        /// 获取当前登录用户粉丝列表及每个粉丝的最新一条微博，返回结果(next_cursor字段，表示下一页的cursor)按粉丝的关注时间倒序排列，最新关注的粉丝排在最前面。注意：最多只能返回5000个
        /// </summary>
        /// <param name="count">单页返回的记录条数(默认值20，最大值200)</param>
        /// <param name="cursor">分页(-1:返回第一页；0:已经到记录末尾)</param>
        /// <returns></returns>
        public string GetFollowers(int count, int cursor, OAuthBase oaubase)
        {
            return GetFollowers(null, count, cursor, oaubase);
        }

        /// <summary>
        /// 获取用户粉丝列表及每个粉丝的最新一条微博，返回结果(next_cursor字段，表示下一页的cursor)按粉丝的关注时间倒序排列，最新关注的粉丝排在最前面。注意：最多只能返回5000个
        /// </summary>
        /// <param name="user_id">用户ID</param>
        /// <param name="count">单页返回的记录条数(默认值20，最大值200)</param>
        /// <param name="cursor">分页(-1:返回第一页；0:已经到记录末尾)</param>
        /// <returns></returns>
        public string GetFollowers(string user_id, int count, int cursor, OAuthBase oaubase)
        {
            cursor = Math.Max(-1, cursor);
            count = Math.Max(5, count);
            count = Math.Min(200, count);
            string url = string.Format("http://api.t.sina.com.cn/statuses/followers.json?count={0}&cursor={1}", count, cursor);
            //cursor用于分页请求，请求第1页cursor传-1，在返回的结果中会得到next_cursor字段，表示下一页的cursor。next_cursor为0表示已经到记录末尾。
            if (!string.IsNullOrEmpty(user_id))
            {
                url += string.Format("&user_id={0}", user_id);
            }
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        /// <summary>
        /// 返回与关键字相匹配的微博用户。
        /// </summary>
        /// <param name="keyword">关键字</param>
        /// <param name="snick">搜索范围是否包含昵称。0为不包含，1为包含。</param>
        /// <param name="sdomain">搜索范围是否包含个性域名。0为不包含，1为包含。</param>
        /// <param name="sintro">搜索范围是否包含简介。0为不包含，1为包含。</param>
        /// <param name="province"></param>
        /// <param name="city"></param>
        /// <param name="gender">性别 (m 为男，f 为女，n 为未知) </param>
        /// <param name="comorsch">公司学校名称。</param>
        /// <param name="sort">排序方式，1为按更新时间，2为按粉丝数。 </param>
        /// <param name="page">页码</param>
        /// <param name="count">每页返回的用户数。默认10条</param>
        /// <param name="base_app">是否基于当前应用来获取数据。1表示基于当前应用来获取数据。</param>
        /// <returns></returns>
        public string SearchUser(string keyword, bool snick, bool sdomain, bool sintro, int province, int city, string gender, string comorsch, int sort, int page, int count, bool base_app, OAuthBase oaubase)
        {
            string url = string.Format("http://api.t.sina.com.cn/users/search.json?q={0}", Utility.UrlEncode(keyword));
            url += string.Format("&snick={0}", snick ? 1 : 0);
            url += string.Format("&sdomain={0}", sdomain ? 1 : 0);
            url += string.Format("&sintro={0}", sintro ? 1 : 0);
            url += string.Format("&province={0}", province);
            url += string.Format("&city={0}", city);
            if ("m".Equals(gender) || "f".Equals(gender))
            {
                url += string.Format("&gender={0}", gender);
            }
            if (!string.IsNullOrEmpty(comorsch))
            {
                url += string.Format("&comorsch={0}", comorsch);
            }
            if (sort == 1 || sort == 2)
            {
                url += string.Format("&sort={0}", sort);
            }
            url += string.Format("&page={0}", Math.Max(page, 1));
            url += string.Format("&count={0}", Math.Max(5, count));
            url += string.Format("&base_app={0}", snick ? 1 : 0);

            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }

        #region 关注相关接口
        /// <summary>
        /// 添加关注
        /// </summary>
        /// <param name="user_id">要关注用户的id</param>
        /// <returns></returns>
        public string CreateFriend(string user_id, OAuthBase oaubase)
        {
            string url = @"http://api.t.sina.com.cn/friendships/create.json";
            string para = string.Format("user_id={0}", user_id);
            return oaubase.OAuthWebRequest(Method.POST, url, para, null);
        }

        /// <summary>
        /// 取消关注
        /// </summary>
        /// <param name="user_id">要取消关注用户的id</param>
        /// <returns></returns>
        public string DestroyFriend(string user_id, OAuthBase oaubase)
        {
            string url = @"http://api.t.sina.com.cn/friendships/destroy.json";
            string para = string.Format("user_id={0}", user_id);
            return oaubase.OAuthWebRequest(Method.POST, url, para, null);
        }

        /// <summary>
        /// 判断用户a是否关注了用户b，返回示例：{"friends":true}
        /// </summary>
        /// <param name="user_a"></param>
        /// <param name="user_b"></param>
        /// <returns></returns>
        public string IsFriend(string user_a, string user_b, OAuthBase oaubase)
        {
            string url = string.Format("http://api.t.sina.com.cn/friendships/exists.json?user_a={0}&user_b={1}", user_a, user_b);
            return oaubase.OAuthWebRequest(Method.GET, url, null, null);
        }
        #endregion

        #region 发表微博、评论、私信、@me 接口
        /// <summary>
        /// 发布一条微博信息
        /// </summary>
        /// <param name="sMessage">文字内容</param>
        /// <returns>未知</returns>
        public string AddWeiBo(string sMessage, OAuthBase oaubase)
        {
            string url = @"http://api.t.sina.com.cn/statuses/update.json";
            return oaubase.OAuthWebRequest(Method.POST, url, "status=" + Utility.UrlEncode(sMessage), null);
        }

        /// <summary>
        /// 发布一条图片微博信息
        /// </summary>
        /// <param name="sMessage">文字内容</param>
        /// <param name="pictureFilename">图片文件路径</param>
        /// <returns>未知</returns>
        public string AddWeiBo(string sMessage, string pictureFilename, OAuthBase oaubase)
        {
            string url = @"http://api.t.sina.com.cn/statuses/upload.json";
            return oaubase.OAuthWebRequest(Method.POST, url, "status=" + Utility.UrlEncode(sMessage), pictureFilename);
        }

        /// <summary>
        /// 评论一条微博
        /// </summary>
        /// <param name="id">微博ID</param>
        /// <param name="comment">评论</param>
        /// <returns></returns>
        public string Comment(string id, string comment, OAuthBase oaubase)
        {
            string url = @"http://api.t.sina.com.cn/statuses/comment.json";
            string para = string.Format("id={0}&comment={1}", id, Utility.UrlEncode(comment));
            return oaubase.OAuthWebRequest(Method.POST, url, para, null);
        }

        /// <summary>
        /// 根据ID转发一条微博
        /// </summary>
        /// <param name="id">微博ID</param>
        /// <returns></returns>
        public string Repost(string id, OAuthBase oaubase)
        {
            return this.Repost(id, null, 0, oaubase);
        }

        /// <summary>
        /// 根据ID转发并评论一条微博,is_comment(是否在转发的同时发表评论0表示不发表评论，1表示发表评论给当前微博，2表示发表评论给原微博，3是1、2都发表。默认为0。)
        /// </summary>
        /// <param name="id">微博ID</param>
        /// <param name="status">转发文本</param>
        /// <param name="is_comment">是否在转发的同时发表评论。0表示不发表评论，1表示发表评论给当前微博，2表示发表评论给原微博，3是1、2都发表。默认为0。 </param>
        /// <returns></returns>
        public string Repost(string id, string status, int is_comment, OAuthBase oaubase)
        {
            is_comment = Math.Max(is_comment, 0);
            is_comment = Math.Min(is_comment, 3);
            string url = @"http://api.t.sina.com.cn/statuses/repost.json";
            string para = string.Format("id={0}&is_comment={1}", id, is_comment);
            if (!string.IsNullOrEmpty(status))
            {
                para += "&status=" + Utility.UrlEncode(status);
            }
            return oaubase.OAuthWebRequest(Method.POST, url, para, null);
        }

        /// <summary>
        /// 发送私信
        /// </summary>
        /// <param name="user_id">私信接收方id</param>
        /// <param name="msg">私信内容</param>
        /// <returns></returns>
        public string AddMessage(string user_id, string msg, OAuthBase oaubase)
        {
            string url = @"http://api.t.sina.com.cn/direct_messages/new.json";
            string para = string.Format("user_id={0}&text={1}", user_id, Utility.UrlEncode(msg));
            return oaubase.OAuthWebRequest(Method.POST, url, para, null);
        }

        #endregion

        #endregion

        #region ITimeline 成员


        public string Comment(string id, string comment, int comment_ori, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}", BASE_URL, "comment.json");
            string para = string.Format("id={0}&comment={1}&without_mention=0&comment_ori={2}", id, Utility.UrlEncode(comment), comment_ori);
            return oaubase.OAuthWebRequest(Method.POST, url, para, null);
        }

        #endregion

        #region ITimeline 成员


        public string CommentDestroy(string id, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}/{2}.json", BASE_URL, "comment_destroy", id);
            string para = string.Format("id={0}", id);
            return oaubase.OAuthWebRequest(Method.POST, url, para);
        }

        #endregion

        #region ITimeline 成员


        public string ReplyComment(string id, string cid, string content, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}.json", BASE_URL, "reply");
            string para = string.Format("id={0}&cid={1}&comment={2}&without_mention=0", id, cid, Utility.UrlEncode(content));
            return oaubase.OAuthWebRequest(Method.POST, url, para);
        }

        #endregion

        #region ITimeline 成员


        public string GetDirectMessage(OAuthBase oaubase)
        {
            string url = @"http://api.t.sina.com.cn/direct_messages.json";
            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }

        public string GetDirectMessage(int count, OAuthBase oaubase)
        {
            string url = string.Format(@"http://api.t.sina.com.cn/direct_messages.json?count={0}", count);
            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }

        public string GetDirectMessage(int count, int page, OAuthBase oaubase)
        {
            string url = string.Format(@"http://api.t.sina.com.cn/direct_messages.json?count={0}&page={1}", count,page);
            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }

        public string GetDirectMessage(int count, string max_id, OAuthBase oaubase)
        {
            string url = string.Format(@"http://api.t.sina.com.cn/direct_messages.json?count={0}&max_id={1}", count, max_id);
            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }


        #endregion

        #region ITimeline 成员


        public string DestroyMessage(string id, OAuthBase oaubase)
        {
            string url = string.Format("http://api.t.sina.com.cn/direct_messages/destroy/{0}.json", id);
            string para = string.Format("id={0}", id);
            return oaubase.OAuthWebRequest(Method.POST, url, para);
        }

        #endregion

        #region ITimeline 成员


        public string GetRepostTimeLine(string id, OAuthBase oaubase)
        {
            string url = string.Format("http://api.t.sina.com.cn/statuses/repost_timeline.json?id={0}", id);
            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }

        public string GetRepostTimeLine(string id, string maxId, OAuthBase oaubase)
        {
            string url = string.Format("http://api.t.sina.com.cn/statuses/repost_timeline.json?id={0}&max_id={1}&count={2}", id, maxId, 200);
            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }

        public string GetComentsByStatusId(string id, OAuthBase oaubase)
        {
            string url = string.Format("http://api.t.sina.com.cn/statuses/comments.json?id={0}", id);
            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }
        #endregion

        #region ITimeline 成员


        public string DestoryStatus(string id, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}/{2}.json", BASE_URL, "destroy", id);
            string postData = string.Format("id={0}", id);
            return oaubase.OAuthWebRequest(Method.POST, url, postData);
        }

        #endregion

        public string SearchStatus(string search, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}", BASE_URL, "search.json");
            url = string.Format("{0}?q={1}&count=200", url, Utility.UrlEncode(search));
            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }

        #region ITimeline 成员


        public string SearchStatus(string search, int count, int pageIndex, OAuthBase oaubase)
        {
            string url = string.Format("{0}/{1}", BASE_URL, "search.json");
            url = string.Format("{0}?q={1}&count={2}&page={3}&needcount={4}", url, Utility.UrlEncode(search), count, pageIndex, Utility.UrlEncode("true"));
            return oaubase.OAuthWebRequest(Method.GET, url, null);
        }

        #endregion

    }
}
